package com.polaris.live.adapter.home

import android.view.LayoutInflater
import android.view.ViewGroup
import com.polaris.live.adapter.live.BannerViewHolder
import com.polaris.live.common.adapter.BaseAdapter
import com.polaris.live.common.constant.CommonConst
import com.polaris.live.databinding.AdapterListBannerBinding
import com.polaris.live.resp.back_resp.ListWithBannerBean

/**
 * HomeBannerAdapter
 *
 * @author Created by 半仙 on 2024/11/26/026 17:34
 */
class HomeBannerAdapter : BaseAdapter<ListWithBannerBean, BannerViewHolder>(0) {

    override fun getDefItemViewType(position: Int): Int {
        return CommonConst.HomeListType.TYPE_BANNER
    }

    override fun onCreateDefViewHolder(parent: ViewGroup, viewType: Int): BannerViewHolder {
        val layoutInflater = LayoutInflater.from(parent.context)
        return BannerViewHolder(
            AdapterListBannerBinding.inflate(layoutInflater, parent, false), 8
        )
    }

    override fun convert(holder: BannerViewHolder, item: ListWithBannerBean) {
        holder.bind(item)
    }
}